/***************************************************
> Copyright (C) 2024 ==LX== All rights reserved.
> File Name: function.c
> Author: lx
> Mail:2998218073@qq.com 
> Created Time: 2024年12月06日 星期五 10时44分13秒
***************************************************/
#include "function.h"

void packJson(DATA data)
{
	cJSON* root = cJSON_CreateObject();
	cJSON* order = cJSON_CreateString(data.order);
	cJSON_AddItemToObject(root, "order", order);

	cJSON* ph = cJSON_CreateString(data.wq->ph);
	cJSON* time = cJSON_CreateString(data.wq->mytime);

	cJSON_AddItemToObject(root, "data", ph);
	cJSON_AddItemToObject(root, "time", time);
	
	char* p = buff;
	p = cJSON_Print(root);
	strcpy(buff, p);
	cJSON_Delete(root);
}